package dev.grafosPert;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class Nuevo extends Activity{

	SharedPreferences prefs;
	SharedPreferences.Editor editor;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.nuevo);

		final EditText ETnumerovariables = (EditText)findViewById(R.id.etnumerovariables);
		final EditText ETnombre = (EditText)findViewById(R.id.etnombre);
		Button Bnuevocontinuar = (Button)findViewById(R.id.bnuevocontinuar);
		
		Bnuevocontinuar.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {

				prefs = getSharedPreferences("MisPreferencias", Context.MODE_PRIVATE);
				editor = prefs.edit();

				editor.putInt("NumeroVariables", Integer.parseInt(ETnumerovariables.getText().toString()));
				editor.putString("Nombre", ETnombre.getText().toString());
				editor.commit();

				Intent intent = new Intent(Nuevo.this, DeclaraMatriz.class);
				startActivity(intent);
	        }
	    });
		
		
		
		
	}


	
	
	
}
